package com.student.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.directwebremoting.annotations.DataTransferObject;
import org.directwebremoting.annotations.RemoteProperty;
/**
 * Course entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "Course", schema = "dbo", catalog = "StudentManager")
public class Course implements java.io.Serializable {


	private Long courseId;
	private ClassInfo classInfo;
	private String courseName;
	private String creationDepartment;
	private String courseNature;
	private String instructors;
	private String examinationWay;
	private String credit;
	private Integer courseHour;
	private Set<MarkAssociation> markAssociations = new HashSet<MarkAssociation>(
			0);



	/** default constructor */
	public Course() {
	}

	/** minimal constructor */
	public Course(Long courseId, String courseName) {
		this.courseId = courseId;
		this.courseName = courseName;
	}

	/** full constructor */
	public Course(Long courseId, ClassInfo classInfo, String courseName,
			String creationDepartment, String courseNature, String instructors,
			String examinationWay, String credit, Integer courseHour,
			Set<MarkAssociation> markAssociations) {
		this.courseId = courseId;
		this.classInfo = classInfo;
		this.courseName = courseName;
		this.creationDepartment = creationDepartment;
		this.courseNature = courseNature;
		this.instructors = instructors;
		this.examinationWay = examinationWay;
		this.credit = credit;
		this.courseHour = courseHour;
		this.markAssociations = markAssociations;
	}

	// Property accessors
	@Id
	@Column(name = "Course_id", unique = true, nullable = false, precision = 18, scale = 0)
	@GeneratedValue
	public Long getCourseId() {
		return this.courseId;
	}

	public void setCourseId(Long courseId) {
		this.courseId = courseId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "Class_id")
	public ClassInfo getClassInfo() {
		return this.classInfo;
	}

	public void setClassInfo(ClassInfo classInfo) {
		this.classInfo = classInfo;
	}

	@Column(name = "Course_Name", nullable = false, length = 50)
	public String getCourseName() {
		return this.courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	@Column(name = "Creation_Department", length = 128)
	public String getCreationDepartment() {
		return this.creationDepartment;
	}

	public void setCreationDepartment(String creationDepartment) {
		this.creationDepartment = creationDepartment;
	}

	@Column(name = "Course_Nature", length = 128)
	public String getCourseNature() {
		return this.courseNature;
	}

	public void setCourseNature(String courseNature) {
		this.courseNature = courseNature;
	}

	@Column(name = "Instructors", length = 64)
	public String getInstructors() {
		return this.instructors;
	}

	public void setInstructors(String instructors) {
		this.instructors = instructors;
	}

	@Column(name = "Examination_Way", length = 64)
	public String getExaminationWay() {
		return this.examinationWay;
	}

	public void setExaminationWay(String examinationWay) {
		this.examinationWay = examinationWay;
	}

	@Column(name = "Credit", length = 128)
	public String getCredit() {
		return this.credit;
	}

	public void setCredit(String credit) {
		this.credit = credit;
	}

	@Column(name = "Course_Hour")
	public Integer getCourseHour() {
		return this.courseHour;
	}

	public void setCourseHour(Integer courseHour) {
		this.courseHour = courseHour;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "course")
	public Set<MarkAssociation> getMarkAssociations() {
		return this.markAssociations;
	}

	public void setMarkAssociations(Set<MarkAssociation> markAssociations) {
		this.markAssociations = markAssociations;
	}

}